package com.hopes.bizz.risk.statistic.controller;

import com.hopes.bizz.risk.statistic.serivce.GisService;
import com.hopes.boss.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yumr
 * @Description 一张图统计接口
 * @time 2023/8/8 16:31
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/gisStatistic" )
@Tag(description = "gis" , name = "一张图统计接口" )
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class GISController {

    private final GisService gisService;

    @GetMapping(value = "/riskLayer")
    @Operation(summary = "风险分区管控", description = "风险分区管控")
    public R riskLayer() {
        return R.ok(gisService.riskLayerData());
    }

    @GetMapping(value = "/riskCount")
    @Operation(summary = "风险管控信息" , description = "风险管控信息")
    public R riskCount() {
        return R.ok(gisService.riskCountStatistic());
    }

    @GetMapping(value = "/riskLevel")
    @Operation(summary = "统计风险对象、单元、事件等级", description = "统计风险对象、单元、事件等级")
    public R riskObjectLevel() {
        return R.ok(gisService.riskLevelStatistic());
    }

    @GetMapping(value = "/riskControl")
    @Operation(summary = "统计管控措施各分类数量", description = "统计管控措施各分类数量")
    public R riskControlClassify() {
        return R.ok(gisService.riskControlClassify());
    }

    @GetMapping(value = "/hidTypeInfoYear")
    @Operation(summary = "隐患整改动态管控-本年度", description = "隐患整改动态管控-本年度")
    public R riskHidTypeInfoYear() {
        return R.ok(gisService.riskHidTypeInfoYear());
    }

    @GetMapping(value = "/hiddenDangerYear")
    @Operation(summary = "隐患整改总览-本年度", description = "隐患整改总览-本年度")
    public R riskHiddenDangerYear() {
        return R.ok(gisService.riskHiddenDangerYear());
    }

    @GetMapping(value = "/riskTaskRecordYear")
    @Operation(summary = "双重预防任务排查统计-本年度", description = "双重预防任务排查统计-本年度")
    public R riskTaskRecordYear() {
        return R.ok(gisService.riskTaskRecordYear());
    }

}
